package com.cloud.code.真题;

import java.util.Scanner;

/**
 * 执行时长
 */
public class Demo30 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()){

            int canExe = Integer.parseInt(scanner.nextLine());
            int group = Integer.parseInt(scanner.nextLine());
            String line = scanner.nextLine();
            String[] s = line.split(" ");

            int count = 0;
            int cur = 0;

            for (int i = 0; i < s.length; i++) {
                int num = Integer.parseInt(s[i]);

                while (cur+num > group){
                    count++;
                    cur-=canExe;
                }
                cur=cur+num-canExe;
                if(cur<0){
                    cur = 0;
                }
                count++;
            }

            if(cur > 0){
                count++;
            }

            System.out.println(count);

        }
    }
}
